package javase0823;

import javase0823.miao.Kitty;
import javase0823.miao.Puppy;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Demo02 {
    public static void main(String[] args) {
        Puppy p = new Puppy();

        try {
            int n = 1;
            if (n > 100) {
                System.out.println("error");
                throw new Exception("");
            }
            if (n < 0) {
                System.out.println("error");
                throw new Exception("");
            }
            p.setAge(n);
        } catch (Exception e){

        }

        // 动物 ： 猫 狗
        Kitty k = new Kitty();
        k.foo();
        p.foo();

        Date d = new Date();
        //DateFormat, Calendar, TimeZone
        SimpleDateFormat df = new SimpleDateFormat();
        Calendar c = new GregorianCalendar();
        Calendar rightNow = Calendar.getInstance();
    }
}
